Tips for Macros

The following tips will help you to get the most out of PTFB Pro's macros.

The Importance of Playback Speed

By default, each new macro is set to playback at maximum speed, eliminating all unnecessary mouse movement. This will be the most suitable setting in many cases, but sometimes the target window may not be able to keep up with this rapid-fire delivery of commands. When this happens, the macro may appear to "skip" a few steps, and you may hear beeps as the window signals that it is not ready to receive more commands.

This is most likely to happen if your computer is a little slow and/or the application you're running is bulky or complex. One solution to this is to tweak the playback settings for your macro - try reducing the speed, try disabling the "Eliminate redundant mouse movement", or if necessary try both. The Macro Editing tab is particularly handy for this kind of experimentation - you can reduce the speed and immediately see the results by hitting the Test Now button.

If you don't like the idea of reducing playback speed, there may be an alternative. Try deleting then recreating the macro but this time use the keyboard during recording rather than the mouse. It's sometimes the case that even though a window isn't ready to respond to mouse commands, it will respond to keys (the so-called "type ahead facility"). See the next section for other reasons why keyboard control sometimes wins out over the mouse...

One other thing to consider. If the target application (or Windows) is using brief animation sequences such as menu fade-in, turning this animation off may improve matters.

Keyboard control is sometimes preferable to using the mouse

When PTFB Pro records a macro, mouse positions are stored relative to the original target window. Consequently playback of mouse actions may fail if objects within the window move around from one session to the next, or if the window is resized.

For example, Windows automatically repositions popup menus to avoid running off the edge of the screen. If you define a macro that selects from such a menu using the mouse, it could fail if Windows decides to make the menu appear at a different location.

Fortunately, most programs can be controlled by the keyboard as well as the mouse, and keyboard commands are NOT position dependent. If you bring up a menu with the mouse, but select from it using the arrow keys and the Return key, your macro will be more robust.

Note that Windows XP sometimes hides the shortcut keys that can be used to control a window. Hitting the ALT key brings the shortcut keys back!

Beware commands that rely on previous operations (e.g. copy to clipboard)

Let's say you have copied some text to the clipboard, and you now define a macro that pastes that text into a window. Your macro will only behave as expected so long as that same text is in the clipboard!

This may seem obvious now, but it's surprising how may people get caught out when they're engrossed in a task.

Use the Pause/Break key to end a recording

PTFB Pro's recording dialog contains a "Stop" button. This works perfectly well, but the recording may contain the movement of the mouse towards the Stop button. This usually isn't a problem (especially if "Eliminate redundant mouse movement" is enabled), but hitting the Break key will stop the recording instantly, without any superfluous mouse movement.

Use CTRL + ESC or Pause/Break to abort macro playback

Windows locks out normal keyboard and mouse movement while a macro is playing back. This isn't an issue if you go with PTFB Pro's default settings - even long macros play back in the blink of an eye. But if you set playback at normal speed, you might want to interrupt it to regain control of your computer.

There are two ways to do this:

  1. Tap the Pause/Break key. On a typical desktop keyboard this sit alongside Scroll Lock and Print Screen.
  2. Hold down the CTRL key and tap the ESC key. Incidentally, these are the same keys that open up the Start menu, so may see that pop open at the same time. Just hit ESC again to dismiss it.